import React from "react";
import { Row, Col } from "antd";
import { isPhone } from 'utils/comm';
import styles from "./ProcessInfo.less";

const Status = {
  "NORMAL": "正常",
  "WARNING": "预警",
  "TIMEOUT": "超时",
  "END": "终止",
  "PAUSE": "暂停",
  "RECALL": "撤销",
  "ERROR": "错误",
};

const LinkStatus = {
  "START": "启动",
  "RUNNING": "进行中",
  "END": "结束",
};

const span = isPhone() ? 24 : 6
const bigSpan = isPhone() ? 24 : 12;
const ProcessInfo = ({ data }) => {
  return (
    <div className={styles.box}>
      <Row>
        <Col span={span}>
          <span className={styles.lable}>流程名称：</span>
          <span>{data.modelName}</span>
        </Col>
        <Col span={span}>
          <span className={styles.lable}>发起人：</span>
          <span>{data.applyUserName}</span>
        </Col>
        <Col span={span}>
          <span className={styles.lable}>发起时间：</span>
          <span>{data.applyTime}</span>
        </Col>
        <Col span={span}>
          <span className={styles.lable}>状态：</span>
          <span>{(data.status && Status[data.status]) || "--"}</span>
        </Col>
      </Row>
      <Row>
        <Col span={span}>
          <span className={styles.lable}>当前环节：</span>
          <span>{(data.linkStatus && LinkStatus[data.linkStatus]) || "--"}</span>
        </Col>
        <Col span={span}>
          <span className={styles.lable}>所属应用：</span>
          <span>{data.appName}</span>
        </Col>
        <Col span={bigSpan}>
          <span className={styles.lable}>所属业务：</span>
          <span>{data.busiName}</span>
        </Col>
      </Row>
      <Row>
        <Col span={bigSpan}>
          <span className={styles.lable}>流程说明：</span>
          <span>{data.description}</span>
        </Col>
      </Row>
      {/* <Row>
        <Col span={8}>
          <span className={styles.lable}>当前环节：</span>
          <span>{data.taskName}</span>
        </Col>
        <Col span={16}>
          <span className={styles.lable}>到单时间：</span>
          <span>{data.createTime}</span>
        </Col>
      </Row> */}
    </div>
  );
};
export default ProcessInfo;
